<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head></h:head> 
<body>
 <h:form>
  
  		<p:commandButton value="Menu" action="#{menuBean.index}" ajax="false"/>
  
  </h:form>


<h:form  Id="form">  
  
 
  
    <p:dataTable id="centroBean" var="cent" value="#{centroBean.buscarTodos}" widgetVar="centBean"   
            emptyMessage="Nenhum Registro Encontrado" paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="10,20,30">  
        <f:facet name="header">  
            Pesquisas de Centro  
        </f:facet>  
              
         
  
  		<p:column id="codigoColumn" filterBy="#{cent.id}"   
                headerText="Codigo" footerText="Codigo"  
                filterMatchMode="contains">  
                
            <h:outputText value="#{cent.id}" />  
        </p:column>
  
  		<p:column id="nomeColumn" filterBy="#{cent.nome}"   
                headerText="Nome" footerText="Nome"  
                filterMatchMode="contains">  
            <h:outputText value="#{cent.nome}" />  
        </p:column>
        
        <p:column id="inicioColumn" filterBy="#{cent.inicio}"   
                headerText="Inicio" footerText="Inicio"  
                filterMatchMode="contains">  
            <h:outputText value="#{cent.inicio}" />  
        </p:column>      
        
        <p:column id="terminoColumn" filterBy="#{cent.encerramento}"   
                headerText="Termino" footerText="Termino"  
                filterMatchMode="contains">  
            <h:outputText value="#{cent.encerramento}" />  
        </p:column>
        
        <p:column>
			
			<f:facet name="header">
				<h:outputText value="Alterar" />
			</f:facet>	
			
			<h:commandButton  value="Alterar" action="#{centroBean.preparaAlterar()}" />
		
		</p:column>	
        
        
       

 </p:dataTable>
      
</h:form>  
 

</body> 

</html>
